package org.example.flatmap;

import java.util.Arrays;
import java.util.stream.IntStream;
import java.util.stream.LongStream;
import java.util.stream.Stream;

public class Java8FlatMap8 {
    public static void main(String[] args) {
        int[] array = {1,2,3,4,5,6};
        Stream<int[]> streamArray = Stream.of(array);
        IntStream intStream = streamArray.flatMapToInt(Arrays::stream);
        intStream.forEach(System.err::println);

        long[] longArray = {1,2,3,4,5,6};
        Stream<long[]> longStream = Stream.of(longArray);
        LongStream longStream1 = longStream.flatMapToLong(x -> Arrays.stream(x));
        longStream1.forEach(System.err::println);

    }
}
